<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>桂林电子科技大学党支部论坛</title>
    <link rel="stylesheet" href="../../css/login/index.css">
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<div class="wrapper" id="wrapper">
    <div id="header">
        党支部
    </div>
    <div class="main" id="main">
        <br>
        <div><h2 >登录</h2></div><br>
        <form action="/login.do" method="post" onsubmit="return checkip()">
            <input type="text" id="username" name="username" th:value="${username}" placeholder="用户名" onclick="empty()"><br>
            <span id="ray"></span><br>
            <input type="password" id="password" name="password" placeholder="密码" th:value="${password}" onclick="empty()"><br>
            <span id="ray1" ></span><br>
            <span id="ray2" th:text="${uandp}"></span><br>
            <input type="text" name="code" id="code"  placeholder="验证码"style="height:30px;width:100px;" onclick="empty1()">
            <img alt="验证码" id="scode" src="/authCode.do">
            <a id="a" href="javascript:void(0)" onclick="flushcode()">看不清?</a><br>
            <span id="ray3" th:text="${codenull}" ></span><br>
            <span id="ray4" th:text="${codef}"></span><br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="checkbox" name="rem" id="rem">记住我<br><br>
            <input type="submit" value="登录" id="button" ><br><br>
        </form> &nbsp;&nbsp;
        <a href="/forget1.do">忘了密码？</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <a href="/mail.do">还没账号？立即注册</a>

    </div>
    <div id="footer" name="footer">
        <a href="#"><P style="text-align:center;padding-top:7px ;"  id="school">桂林电子科技大学</P></a>
    </div>
</div>
<script>
    function empty1() {
        $("#ray3").text("");
        $("#ray4").text("");
    }
    function empty() {
        $("#ray").text("");
        $("#ray1").text("");
        $("#ray2").text("");
    }
    function checkip() {
        var username=$("#username").val()
        var password=$("#password").val()
        if(username==""||password==""){
            if(username==""){
                $("#ray").text("请输入你的用户名");
            }
            if(password==""){
                $("#ray1").text("请输入你的密码");
            }
            return false;
        }else return true;
    }
    function flushcode() {
        var time = new Date();
        document.getElementById("scode").src = "/authCode.do?time=" + time;
    }
</script>
</body>
</html>